//
//  CommunityTopicList.m
//  ArtDog
//
//  Created by dllo on 16/9/3.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CommunityTopicList.h"
#import "CommunityTopicLabelList.h"
#import "CommunityPicture.h"
#import "CommunityHotCommentList.h"

@implementation CommunityTopicList

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        _idField = value;
    }
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"topicLabelList"]) {
        NSMutableArray<CommunityTopicLabelList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            CommunityTopicLabelList *topicLabelList = [CommunityTopicLabelList modelWithDic:dic];
            [array addObject:topicLabelList];
        }
        _topicLabelList = array;
    } else if ([key isEqualToString:@"pictures"]) {
        NSMutableArray<CommunityPicture *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            CommunityPicture *pictures = [CommunityPicture modelWithDic:dic];
            [array addObject:pictures];
        }
        _pictures = array;
        
    } else if ([key isEqualToString:@"hotCommentList"]) {
        NSMutableArray<CommunityHotCommentList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            CommunityHotCommentList *hotCommentList = [CommunityHotCommentList modelWithDic:dic];
            [array addObject:hotCommentList];
        }
        _hotCommentList = array;
        
    }
}


@end
